﻿using AgileLabs.Dapper.FluentMap;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
using System.Threading.Tasks;

namespace Dapper.Repository
{
    public  interface IBaseRepository
    {
        T Get<T>(Guid id, bool withCurrentTransacfion = false) where T : class;
        IEnumerable<T> GetAll<T>() where T : class;
        IEnumerable<T> Select<T>(Expression<Func<T, bool>> predicate) where T : class;
        PagedList<T> Query<T>(Expression<Func<T, bool>> predicate, Expression<Func<T, object>> orderByExpression = null,
            bool orderByAsc = true,
            int? pageNo = null, int? pageSize = null) where T : class;
        object Insert<T>(T obj) where T : class;
        void InsertList<T>(IEnumerable<T> list) where T : class;
        bool Update<T>(T obj) where T : class;
        void UpdateList<T>(IEnumerable<T> list) where T : class;
        bool Delete<T>(T obj) where T : class;
        bool DeleteMultiple<T>(Expression<Func<T, bool>> predicate) where T : class;
        bool DeleteAll<T>() where T : class;
        void Commit();
        void Rollback();
    }
}
